#include "func.h"
#include <Arduino.h>
#include <ESP8266WiFi.h>
#include <ESP8266WebServer.h>
#include <ArduinoJson.h>
#include <FS.h>

extern ESP8266WebServer server;

void onWifiConnected() {
  // 打印连接信息
  Serial.println("\nWiFi连接成功");

}


static unsigned long lastPrint = 0;
void funcLoop() {
  


  // 只有WiFi连接成功时才会执行的循环逻辑
  if (WiFi.status() == WL_CONNECTED) {
    unsigned long currentMillis = millis();
    
    // 每2秒输出一次hello
    if (currentMillis - lastPrint >= 2000) {
      Serial.println("hello");
      lastPrint = currentMillis;
    }
  }
}
